package cn.mulanbay.message.web;

import cn.mulanbay.business.listener.StartListener;
import cn.mulanbay.business.listener.StopListener;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableFeignClients(basePackages="cn.mulanbay.api.system")
@SpringBootApplication(scanBasePackages = "cn.mulanbay.message")
@EnableTransactionManagement
@MapperScan("cn.mulanbay.persistent.mapper")
public class MulanbayMessageApplication {

    private static final Logger logger = LoggerFactory.getLogger(MulanbayMessageApplication.class);

    public static void main(String[] args) {
        SpringApplication sa = new SpringApplication(MulanbayMessageApplication.class);
        sa.addListeners(new StartListener());
        sa.addListeners(new StopListener());
        sa.run(args);
        logger.info("消息中心启动成功");
    }
}
